public class Test {
    public static void main(String[] args){
        class Cat implements Animal {
            public void shout(){
                System.out.println("miao miao miao~~~");
            }
        }
        anmialShout(new Cat());
        anmialShout(new Animal(){
            public void shout(){
                System.out.println("miao miao miao~~~");
            } 
        });
    }
    public static void anmialShout(Animal an){
        an.shout();
    }

}

interface Animal{
    void shout();
}